<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>大风车</title>
		<script src="../js/jquery-1.11.1.js"></script>
		<style>
			.imga{
				animation: dfca 1s linear infinite;
			}
			/* 关键帧 */
			@keyframes dfca{
				0%{
					transform: translate(20px) rotate(180deg);
				}
				30%{
					transform: translate(400px) rotate(360deg);
				}
				100%{
					transform: translate(1200px) rotate(720deg);
				}
			}
			.imgb{
				animation: dfcb 1s linear infinite;
			}
			/* 关键帧 */
			@keyframes dfcb{
				0%{
					transform: translate(20px) rotatex(180deg);
				}
				30%{
					transform: translate(400px) rotatex(360deg);
				}
				100%{
					transform: translate(1200px) rotatex(720deg);
				}
			}
		</style>
	</head>
	<body>
		<img src="../img/1.gif" alt="1" width="350px" height="350px"/>
		<audio src="../img/dafengche.mp3" autoplay></audio>
		<button id="btn1">开始</button>
		<button id="btn2">暂停</button>
		<button id="btn3">翻转</button>
		
		<script>
			$("#btn1").click(function(){
				$("img").attr("src","../img/dfc.jpg").addClass("imga");
			});
			$("#btn2").click(function(){
				$("img").removeClass("imga imgb");
				$("audio").removeAttr("src");
			});
			$("#btn3").click(function(){
				$("img").toggleClass("imgb");
				$("audio").attr("src","../img/dafengche.mp3");
			});
		</script>
	</body>
</html>